<?php
	include_once 'isLogin.php';
	$table_name='companies_accounting';

	//删除
	if($_GET['action']=='del'){
		echo $commonc->del($table_name,$_POST['id']);
		exit();
	}
	//修改
	if($_GET['action']=='edit'){
		$arr = array($key_index[$_POST['index']]=>$_POST['value']);
		echo $commonc->update($table_name,$arr,"id='".$_POST['value_id']."'");
		exit();
	}

	$sql=$table_name." where company_id=".$company_id." order by date DESC";
	$res=$commonc->getList($sql , $sql);
	 
	$smarty->assign('res',$res['result']);
	$smarty->assign('page',$res['page']);
	$smarty->display($_filename.".html");
?>